package com.tengju.settlement.domain.model.depository;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum LicenseType {

    ID_CARD(1,1,"身份证号码"),
    SOCIAL_CREDIT(2,73,"统一社会信用编码"),
    ;

    Integer innerVal;
    Integer financeVal;
    String desc;

    public static LicenseType fromVal(Integer innerCode) {
        for (LicenseType type : values()) {
            if (type.innerVal.equals(innerCode)) {
                return type;
            }
        }
        return null;
    }


    public static LicenseType fromFinanceCode(Integer financeCode) {
        for (LicenseType type : values()) {
            if (type.financeVal.equals(financeCode)) {
                return type;
            }
        }
        return null;
    }
}
